home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / BlueBox Spy / Blue Box Daemon / source / CTCPResponder.h < prev    next >
Encoding:
Text File  |  1998-08-06  |  1.8 KB  |  66 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    CTCPResponder.h            ©1995-1998 Metrowerks Inc. All rights reserved.
  3. // ===========================================================================
  4.  
  5. #pragma once
  6.  
  7. #include <LSingleDoc.h>
  8. #include <LInternetAddress.h>
  9.  
  10. #include <LTCPEndpoint.h>
  11.  
  12. #include "CSimpleTCPServer.h"
  13. #include "CTerminalPane.h"
  14.  
  15. class CTCPResponderThread;
  16.  
  17. // ===========================================================================
  18. //        • CTCPResponder
  19. // ===========================================================================
  20.  
  21. class CTCPResponder :    public PP_PowerPlant::LSingleDoc {
  22.  
  23. public:
  24.                             CTCPResponder(
  25.                                     LCommander*     inSuper);
  26.                                 
  27.     virtual void            Accept(CSimpleTCPServer * inServer);
  28.     virtual void            Disconnect();
  29.     virtual Boolean            IsIdle();
  30.  
  31.     virtual Boolean            AllowSubRemoval(
  32.                                     LCommander*        inSub);
  33.     virtual Boolean            HandleKeyPress(
  34.                                     const EventRecord& inKeyEvent);
  35.  
  36.     virtual void            BindCompleted();
  37.     virtual void            BindFailed();
  38.     
  39.     virtual void            ServerThreadDied();
  40.  
  41.     virtual Boolean            AttemptQuitSelf(
  42.                                 SInt32    inSaveOption);
  43.                                 
  44. protected:
  45.  
  46.     virtual                    ~CTCPResponder();
  47.  
  48.     void                    BuildServerWindow();
  49.     void                    SetWindowTitle(
  50.                                 PP_PowerPlant::LInternetAddress & inAddress);
  51.                                 
  52.     PP_PowerPlant::LTCPEndpoint*     mEndpoint;
  53.  
  54.     char                            mLineBuffer[256];    // linemode send buffer
  55.     UInt16                            mLineBufferIndex;    // size of mLineBuffer
  56.     bool                            mLineMode;            // true if buffering for entire line
  57.     bool                            mEchoCharacters;    // true to echo keyboard input to screen
  58.  
  59.     CTerminalPane*                    mTerminalPane;        // terminal display for this connection
  60.  
  61.     CTCPResponderThread*            mResponderThread;    // the thread that actually handles the connection
  62.  
  63.     bool                            mQuitWhenDone;        // re-issue quit request when disconnect complete
  64.     SInt32                            mSaveOption;
  65. };
  66.